package com.sbtr.common.enums;

public enum CalculateDataTypeEnum {

    custom(DataTypeEnum.DATE.code,"自定义"),

    ;


    String code;
    String title;
    CalculateDataTypeEnum(String code, String title){
        this.code=code;
        this.title=title;
    }

    public String getCodeByTitle(String title){
        CalculateDataTypeEnum[] calculateEnums = values();
        for (CalculateDataTypeEnum calculateEnum : calculateEnums) {
            if(calculateEnum.getTitle().equals(title)){
                return calculateEnum.getCode();
            }

        }
        return null;
    }
    public String getTitleByCode(String code){
        CalculateDataTypeEnum[] calculateEnums = values();
        for (CalculateDataTypeEnum calculateEnum : calculateEnums) {
            if(calculateEnum.getCode().equals(code)){
                return calculateEnum.getTitle();
            }
        }
        return null;
    }

    public String getCode(){
        return code;
    }
    public String getTitle(){
        return title;
    }

}
